From b630b25e2b82cee2e71b24560c16f58eae5d27dd Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 9 Oct 2005 23:24:35 +0000 Subject: [PATCH] another small optimization SVN-Revision: 2091 --- openwrt/package/webif/files/www/cgi-bin/webif/upgrade.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/upgrade.sh b/openwrt/package/webif/files/www/cgi-bin/webif/upgrade.sh index 6b5fe9a166..50b85af01c 100755 --- a/openwrt/package/webif/files/www/cgi-bin/webif/upgrade.sh +++ b/openwrt/package/webif/files/www/cgi-bin/webif/upgrade.sh @@ -4,12 +4,15 @@ header "System" "Firmware upgrade" "Firmware upgrade" strip_cybertan() { - dd if="$FORM_firmware" of=/tmp/upgrade.bin bs=32 skip=1 2>/dev/null - rm $FORM_firmware + ( + dd of=/dev/null bs=32 count=1 2>/dev/null + cat > /tmp/upgrade.bin + ) < "$FORM_firmware" + rm "$FORM_firmware" } empty "$FORM_submit" || empty "$FORM_firmware" || { - [ -n $FORM_firmware ] && { + exists $FORM_firmware && { HEADER=$(head -c4 $FORM_firmware | hexdump -e "8/1 \"%x\"") grep BCM947 /proc/cpuinfo > /dev/null && { case "$HEADER" in -- 2.30.2